# 单行注释

""""
多行注释
"""
print("大傻春")
name = "大春"
print("输出当前的名字：", name)

# type类型查看的使用
print(type("name"))
print(type(18))
print(type(18.34))

# 变量的类型查看（type)
name="大春"
age = 18
height = 178.63
print(type(name))
print(type(age))
print(type(height))

# 数据类型转换
print("类型转换开始=========================")
str1 = str(18)
print(type(str1))

# 会报错：ValueError: invalid literal for int() with base 10: 'ZTK'
# int1 = int("ZTK")
# print(type(int1))

int1 = int("18")
print(type(int1))

# 会报错：ValueError: could not convert string to float: 'ZTK'
# float1 = float("ZTK")
# print(type(float1))

float1 = float("18.32")
print(type(float1))

# float 转为 int 是直接将小数点后的精度抹除
int1 = int(18.365)
print(int1)

int1 = int(18.51)
print(int1)

# 字符串之间的嵌套
name = '"是个好"人'
print(name)
name = "不，'不是个好人'"
print(name)
name = """
\'就是个好人\',是的
"""
print(name)

# 字符串的拼接
# print("好人" + 123)

name = "郝仁"
age = 18
print("我的名字是%s,我现在的年龄是%s" % (name, str(age)))

print("我的名字是%s,我现在的年龄是%s" % (name, age))

name = "奇葩"
age = 26
height = 180.63
print("我的名字是%s,今年%d岁,身高%fcm" % (name, age, height))

# 数字精度控制
height = 180.635
# %10.2中： 10统计的是总长度， 180.63的总长度为：6，所以%10.2f会在前面补4个空格 2对应的是小数位的长度，保留两位小数
print("身高%10.2f" % height)
print("身高%.2f" % height)
# 对于float数据，写%10f,只针对整数位，不生效
print("身高%10f" % height)

age = 18
print("年龄%5d" % age)

# 字符串的格式化2
name = "大厦"
age = 18
height = 182.63
print(f"我的名字是{name},年龄是{age},身高是{height}")

# 字符串格式化习题
name = "华信永道"
stock_price = 19.9;
stock_code = "003032"
stock_price_daily_growth_factor = 1.2
growth_days = 7
stock_price_daily_growth_factor * growth_days * stock_price
print("公司：%s,股票代码：%s,当前股价：%.2f" % (name, stock_code, stock_price))
print("每日增长系数：%.2f,经过%d天增长后，股价达到了%.2f" % (stock_price_daily_growth_factor, growth_days,
                                      stock_price_daily_growth_factor * growth_days * stock_price))


print("%10s" % 1)

dwzh = "11111111"
count = 100
print(len(dwzh))
print(len(str(count)))